<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <!-- Meta, title, CSS, favicons, etc. -->
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Gentelella Alela! | </title>

  <!-- Bootstrap -->
  <link href="/graduation-manager/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link href="/graduation-manager/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <!-- bootstrap-daterangepicker -->
  <link href="/graduation-manager/vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
  <!-- Ion.RangeSlider -->
  <!-- Bootstrap Colorpicker -->
  <link href="/graduation-manager/vendors/toastr/toastr.min.css" rel="stylesheet">
  <!-- Custom Theme Style -->
  <link href="/graduation-manager/build/css/custom.min.css" rel="stylesheet">
</head>


<!-- page content -->
<body>
<div class="">
  <div class="col-md-12">
    <!-- form date pickers -->
    <div class="x_panel" style="">
      <div class="x_title">
        <h2>Date Pickers
          <small> Available with multiple designs</small>
        </h2>
        <ul class="nav navbar-right panel_toolbox">
          <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
          </li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i
                class="fa fa-wrench"></i></a>
            <ul class="dropdown-menu" role="menu">
              <li><a href="#">Settings 1</a>
              </li>
              <li><a href="#">Settings 2</a>
              </li>
            </ul>
          </li>
          <li><a class="close-link"><i class="fa fa-close"></i></a>
          </li>
        </ul>
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        <form id="form" role="form" method="get" action="/graduation-manager/task/saveByUserInfo.do">
          <div class="form-body">
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="form-group form-md-line-input">
                  <label>标题</label>
                  <input type="text" class="form-control" name="title">
                </div>
              </div>

              <input id="startTime" type="hidden" class="form-control" name="startTimeProxy"/>
              <input id="endTime" type="hidden" class="form-control" name="endTimeProxy"/>

              <div class="col-md-4 col-sm-6 col-xs-12">
                <label>起止时间</label>
                <div class="input-prepend input-group">
                              <span class="add-on input-group-addon"><i
                                  class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
                  <input type="text" style="width: 200px" id="start_end"
                         class="form-control" value=""/>
                </div>
              </div>

              <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="form-group form-md-line-input">
                  <label class="col-md-12">任务目标对象
                    <small>(默认是全体学生)</small>
                  </label>

                  <div class="col-md-4">
                    <label>专业:</label>
                    <select name="department" placeholder="专业">
                      <option value="">请选择</option>
                      <option value="1">计算机</option>
                      <option value="2">软件</option>
                      <option value="3">网络</option>
                    </select>
                  </div>
                  <div class="col-md-4"><label>年级:</label>
                    <select name="grade" placeholder="年级">
                      <option value="">请选择</option>
                      <option value="2013">2013</option>
                      <option value="2013">2014</option>
                      <option value="2013">2015</option>
                    </select>
                  </div>
                  <div class="col-md-4"><label>班级:</label>
                    <select name="klass" placeholder="班级">
                      <option value="">请选择</option>
                      <option value="2013">1班</option>
                      <option value="2013">2班</option>
                      <option value="2013">3班</option>
                    </select>
                  </div>
                </div>
              </div>
              <br/>
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="form-group form-md-line-input">
                  <label>要求</label>
                  <textarea type="text" class="form-control" name="description" data-dftVal=""/>
                </div>
              </div>
            </div>
          </div>
          <div class="ln_solid"></div>
          <div class="col-md-3 col-sm-3 col-xs-12 pull-right">
            <button class="btn btn-primary" type="reset">重置</button>
            <button name="save" type="button" class="btn btn-success">提交</button>
          </div>
        </form>
      </div>
    </div>


    <!-- /page content -->
  </div>
</div>

<!-- jQuery -->
<!--<script src="/graduation-manager/vendors/jquery/dist/jquery.min.js"></script>-->
<!--<script src="/graduation-manager/vendors/bootstrap/dist/js/bootstrap.min.js"></script>-->

<!--<script src="/graduation-manager/vendors/moment/min/moment.min.js"></script>-->
<!--<script src="/graduation-manager/vendors/bootstrap-daterangepicker/daterangepicker.js"></script>-->


<!--&lt;!&ndash; Custom Theme Scripts &ndash;&gt;-->
<!--<script src="/graduation-manager/build/js/custom.js"></script>-->
<!--<script src="/graduation-manager/build/js/common.js"></script>-->

<script>
  $(function () {
    $('.collapse-link').on('click', function () {
      var $BOX_PANEL = $(this).closest('.x_panel'),
          $ICON = $(this).find('i'),
          $BOX_CONTENT = $BOX_PANEL.find('.x_content');

      // fix for some div with hardcoded fix class
      if ($BOX_PANEL.attr('style')) {
        $BOX_CONTENT.slideToggle(200, function () {
          $BOX_PANEL.removeAttr('style');
        });
      } else {
        $BOX_CONTENT.slideToggle(200);
        $BOX_PANEL.css('height', 'auto');
      }

      $ICON.toggleClass('fa-chevron-up fa-chevron-down');
    });

    $('.close-link').click(function () {
      var $BOX_PANEL = $(this).closest('.x_panel');

      $BOX_PANEL.remove();
    });

    $('#start_end').daterangepicker({
      "locale": daterangepicker.locale,//中文配置
//      "showDropdowns": true,//显示月和年的选择下拉框
//      "timePicker": true,//显示小时和分的选择下拉框
//      "timePicker24Hour": true,//24小时制
      "showCustomRangeLabel": false,//是否显示自定义范围
      "alwaysShowCalendars": true,//显示日期选择器
      "minDate": moment(),//最小可选择时间
      //"maxDate": moment(),//最大可选择时间
      //"opens" : 'center',//日期选择器弹出位置
    }, function (start, end, label) {
      $('#startTime').val(start.format("YYYY-MM-DD"));
      $('#endTime').val(end.format("YYYY-MM-DD"));
    });

    $('button[name="save"]').click(function () {
      $.ajax({
        type: 'POST',
        url: $(form).attr('action'),
        data: $(form).serialize(),
        dataType: 'json',
        timeout: 60000,
        success: function (resData, status, xhr) {
          if (resData.code == 200) {
            toastr.success(resData.msg);
          } else {
            toastr.error(resData.msg);
          }
        },
        error: function (xhr, errorType, error) {
          toastr.error("服务器异常");
        }
      })
    });


  })
</script>
</body>
</html>